import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Basic
import QtQuick.Layouts

// TextField - Multiple Topic
Rectangle {
    Layout.fillWidth: true
    Layout.fillHeight: true

    property bool darkMode: false

    Column {
        spacing: 20
        width: 250
        anchors.centerIn: parent

        TextField {
            id: themeTextField
            width: parent.width
            placeholderText: "多主题文本框"

            background: Rectangle {
                implicitWidth: parent.width
                implicitHeight: 40
                color: darkMode ? "#333" : "#fff"
                border.width: parent.activeFocus ? 2 : 1
                border.color: parent.activeFocus ?
                              (darkMode ? "#4caf50" : "#21be2b") :
                              (darkMode ? "#555555" : "#c0c0c0")
                radius: 4
            }

            color: darkMode ? "#fff" : "#333"
            placeholderTextColor: darkMode ? "#aaa" : "#808080"
        }

        Button {
            width: parent.width
            text: darkMode ? "切换至亮色主题" : "切换至暗色主题"
            onClicked: darkMode = !darkMode
        }
    }
}
